//打印从1到最大的n位数
//https://leetcode.cn/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/description/?favorite=xb9nqhhg

/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* printNumbers(int n, int* returnSize)
{
    int sum=0;
    int flag=1;
    for(int i=1;i<=n;i++)
    {
        sum+=9*flag;
        flag*=10;
    }
    int *ret=(int*)malloc(sizeof(int)*sum);
    for(int i=1;i<=sum;i++)
    {
        *(ret+i-1)=i;
    }
      *returnSize=sum;
    return ret;
}